﻿@Html.Label("Team search")
@Html.JQueryUI().Autocomplete("TeamAutocomplete", Url.Action("GetTeams", "Menu"), null, "Name", null, null).MinLength(2).OnSelect("selectedTeamId.onSelect").Delay(250).AutoFocus(true)

<script type="text/javascript">
    var selectedTeamId = {};

    selectedTeamId.onSelect = function (event, ui)
    {
        window.location.href = '@Url.Action("Index", "Team")' + '?teamId=' + ui.item.value;
    }
</script>